<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://sduept.security.el/func"
	template="/template/template.xhtml">
	<ui:define name="head">
		<link rel="stylesheet" href="/resources/bootstrap/css/bootstrap-datetimepicker.min.css" />
		<style>
#WrapProtectTimeLine {
	height: 50px;
	padding-top: 10px;
}
.ui-spinner > input {
	text-align:left;
}
</style>

	</ui:define>
	<ui:define name="content">
		<div class='full-center-content-scroll-noheader'>
			<div id="WrapProtectTimeLine" class="col-sm-12 col-lg-12">
				<!-- 隐藏字段，放置所选单位的值，用来控制单位筛选是否展示 -->
				<h:inputHidden id="unitTypeValue" value="#{protectKpiController.unitType}"/>
				<h:form id="toolForm">
					<div style="float: left;">
						<p:remoteCommand name="selectYear" actionListener="#{protectKpiController.selectYear}" />
						<p:outputLabel value="年：" />
						<!-- <p:spinner size="10" style="margin-right:20px;" min="0" value="#{protectKpiController.year}"/> -->
						<input type="text" id="year" onchange="changeYear()" style="width:80px;text-align:center" />
						
						<p:outputLabel value="月：" style="margin-left:10px;"/>
						<h:selectOneMenu value="#{protectKpiController.month}"
							style="width:80px;height:30px">
							<f:selectItem itemValue="0" itemLabel="全年"/>
							<f:selectItems value="#{protectKpiController.months}" />
						</h:selectOneMenu>
						<p:outputLabel value="电压：" style="margin-left:10px;"/>
						<h:selectOneMenu value="#{protectKpiController.voltage}"
							style="width:110px;margin-right:20px;height:30px">
							<!-- <f:selectItem itemValue="0" itemLabel="220kV及以上"/> -->
							<f:selectItems value="#{protectKpiController.voltages}" var="item" itemValue="#{item}" itemLabel="#{item}kV" />
						</h:selectOneMenu>
						<p:outputLabel value="单位：" style="margin-left:10px;"/>
						<h:selectOneMenu value="#{protectKpiController.unitType}"   
							style="width:110px;margin-right:20px;height:30px">
							<p:ajax event="change" listener="#{protectKpiController.queryChartData}" oncomplete="redrawCharts()" 
								update="maintenanceFilterPanel chartJsonData" />
							<f:selectItem itemValue="0" itemLabel="检修单位"/>
							<f:selectItem itemValue="1" itemLabel="调管单位"/>
						</h:selectOneMenu>
					</div>
					<p:outputPanel id="maintenanceFilterPanel" style="float: left;">
						<p:outputLabel value="单位筛选：" style="margin-left:10px;"  rendered="#{protectKpiController.unitType == 0}"/>
						<p:selectCheckboxMenu filter="true" style="margin-right: 20px; height: 30px" 
							value="#{protectKpiController.selectedMaintenance}" filterMatchMode="startsWith"
							label="单位筛选" panelStyle="width: 300px" rendered="#{protectKpiController.unitType == 0}">
							<f:selectItems value="#{protectKpiController.subCompanys}" />
						</p:selectCheckboxMenu>
					</p:outputPanel>
					<p:commandButton value="查询" icon="ui-icon-search"
						style="margin-right:10px" actionListener="#{protectKpiController.queryChartData}"
						oncomplete="redrawCharts()" update="chartJsonData" />
					<p:commandButton value="重置" icon="ui-icon-refresh"
						style="margin-right:10px"
						actionListener="#{protectKpiController.init()}"
						oncomplete="resetYear()" update="toolForm chartJsonData"/>
					<h:inputHidden id="chartJsonData" value="#{protectKpiController.chartJsonData}" />
					<p:remoteCommand name="updateChartData" oncomplete="redrawCharts()" action="#{protectKpiController.queryChartData}" update="chartJsonData"/>
				</h:form>
			</div>
			<div class="nav-tabs-custom" style="height: 810px;">
				<div class="tab-content no-padding" style="height: 810px;">
					<div class="chart tab-pane active" id="yearCase"
						style="position: relative; height: 760px;">
						<div class="row">
							<div class="col-xs-12">
								<div class="info-box bg-blue">
									<span class="info-box-icon"> <i
										class='icon ion-pie-graph'></i>
									</span>
									<div class="info-box-content">
										<ul>
											<li id="a_title" class="info-box-number"></li>
											<li id="a_li" class="info-box-text"></li>
											<li id="f_li" class="info-box-text"></li>
										</ul>
									</div>
								</div>
							</div>
							<div class="col-xs-12">
								<div class="col-md-6">
									<div class="box box-primary">
										<div class="box-header with-border">
											<h3 class="box-title">各分、子公司保护正确动作率</h3>
											<p:commandButton value="数据维护" icon="ui-icon-document"
												style="float:right" oncomplete="PF('maintProtectActDlg').show()" 
												actionListener="#{protectKpiController.initQueryActData}"
												rendered="#{s:hasPermission(session,'tjfx_bhdzzbfx_bhzqdzlsjwh')}"
												update="protectActForm:maintProtectActDlg" />
										</div>
										<div class="box-body chart">
											<div id='CorrectAction' style="height: 600px;text-align:center;color:grey;font-size:16px;font-weight:bold" />
										</div>
									</div>
								</div>
								<div class="col-md-6">
									<div class="box box-primary">
										<div class="box-header with-border">
											<h3 class="box-title">各分、子公司故障快速切除率</h3>
											<p:commandButton value="数据维护" icon="ui-icon-document"
												style="float:right" oncomplete="PF('maintFaultRemoveDlg').show()"
												actionListener="#{protectKpiController.initQueryRemoveData()}"
												rendered="#{s:hasPermission(session,'tjfx_bhdzzbfx_gzksqclsjwh')}"
												update="faultRemoveForm:maintFaultRemoveDlg" />
										</div>
										<div class="box-body chart">
											<div id='FaultRemove' style="height: 600px;text-align:center;color:grey;font-size:16px;font-weight:bold" />
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<h:form id="protectActForm">
			<p:dialog widgetVar="maintProtectActDlg" header="保护正确动作率数据维护" modal="true"
				id="maintProtectActDlg" width="1300" height="700" onHide="updateChartData()" onShow="initQueryYear()">
				<p:growl id="msgs" showDetail="true" />
				<div class="box box-primary box-solid with-border" style="padding:7px;">
					<p:remoteCommand name="selectQueryYear" actionListener="#{protectKpiController.selectQueryYear}" />
					<h:panelGrid id="toolbars" columns="13" style="margin-left:10px" >
						<p:selectOneRadio id="queryType" value="#{protectKpiController.queryType}" style="margin-right:5px;">
							<p:ajax event="valueChange" listener="#{protectKpiController.queryProtectCorrectAct}" oncomplete="initQueryYear()" update="toolbars toolbar actTab"/>
							<f:selectItem itemLabel="年指标维护" itemValue="0" />
							<f:selectItem itemLabel="月指标维护" itemValue="1" />
						</p:selectOneRadio>
						<p:outputLabel value="年：" />
						<!-- p:spinner size="8" style="margin-right:10px;" min="0" value="#{protectKpiController.mYear}"/> -->
						<input type="text" id="mYear" onchange="changeQueryYear()" style="width:80px;text-align:center;margin-right:10px;" />	
						<p:outputLabel value="月：" style="margin-bottom:10px;text-align:center;margin-top:7px;"/>
						<h:selectOneMenu value="#{protectKpiController.mMonth}"
							rendered="#{protectKpiController.queryType == 1}"
							style="width:60px;margin-right:10px;height:30px">
							<f:selectItem itemValue="0" itemLabel="全年"/>
							<f:selectItems value="#{protectKpiController.months}" />
						</h:selectOneMenu>
						<h:selectOneMenu value="#{protectKpiController.mMonth}"
							rendered="#{protectKpiController.queryType == 0}"
							disabled="#{protectKpiController.queryType == 0}"
							style="width:60px;margin-right:10px;height:30px;background:#dcdcdc;color:transparent">
							<f:selectItem itemValue="0" itemLabel="全年"/>
							<f:selectItems value="#{protectKpiController.months}" />
						</h:selectOneMenu>
						<p:outputLabel value="电压等级 ：" />
						<h:selectOneMenu value="#{protectKpiController.mVoltage}"
							style="width:110px;margin-right:10px;height:30px">
							<!-- <f:selectItem itemValue="0" itemLabel="220kV及以上"/> -->
							<f:selectItems value="#{protectKpiController.voltages}" var="item" itemValue="#{item}" itemLabel="#{item}kV" />
						</h:selectOneMenu>
						<!-- <p:outputLabel value="单位 ："/>
						<h:selectOneMenu value="#{protectKpiController.subCompany}"
							style="width:120px;height:30px;margin-right:10px;" id="actSub">
							<f:selectItem itemLabel="全部" itemValue="全部" />
							<f:selectItems value="#{protectKpiController.subCompanys}" />
						</h:selectOneMenu> -->
						<p:commandButton value="查询" icon="ui-icon-search"  style="margin-right:5px;"
							actionListener="#{protectKpiController.queryProtectCorrectAct()}"
							update="toolbar actTab" />
						<p:commandButton value="重置" icon="ui-icon-refresh"  style="margin-right:5px;"
							actionListener="#{protectKpiController.resetProtectCorrectAct()}" oncomplete="initQueryYear()"
							update="toolbar toolbars actTab" />
						<p:commandButton value="统计" icon="fa fa-bar-chart" style="margin-right:5px;"
							actionListener="#{protectKpiController.countCurrentProtectCorrectAct()}"
							update="actTab msgs">
							<p:confirm header="提示" message="重新统计会覆盖当前年月的统计信息，确定重新统计吗?" icon="ui-icon-alert" />
						</p:commandButton>
						<p:selectBooleanCheckbox style="float: left; margin-left: 5px; margin-top: 6px;" itemLabel="是否覆盖修改数据" 
							value="#{protectKpiController.covered}" />
						<!--<p:commandButton value="统计全部" icon="fa fa-bar-chart"
							actionListener="#{protectKpiController.countAllProtectCorrectAct()}"
							update="actTab msgs">
							<p:confirm header="提示" message="重新统计会删除所有的统计信息，确定重新统计吗?" icon="ui-icon-alert" />
						</p:commandButton>-->
					</h:panelGrid>
				</div>
				<p:toolbar id="toolbar">
					<f:facet name="left">
						<!-- <p:commandButton value="新建年度指标" icon="ui-icon-plus" style="margin-right:5px;"
							actionListener="#{protectKpiController.preCreateProtectCorrectAct(0)}"
							oncomplete="PF('protectActCreateDlg').show()"
							update="protectActCreateDlgForm:protectActCreateDlg" />
						<p:commandButton value="新建月度指标" icon="ui-icon-plus" style="margin-right:5px;"
							actionListener="#{protectKpiController.preCreateProtectCorrectAct(1)}"
							oncomplete="PF('protectActCreateDlg').show()"
							update="protectActCreateDlgForm:protectActCreateDlg" /> -->
						<p:commandButton value="编辑" icon="ui-icon-pencil" id="edit" style="margin-right:5px;"
							actionListener="#{protectKpiController.editProtectCorrectAct}"
							oncomplete="PF('protectActEditDlg').show()"
							update="protectActEditDlgForm:protectActEditDlg"
							disabled="#{protectKpiController.selectProtectCorrectAct.id == null}" />
						<p:commandButton value="删除" icon="ui-icon-trash"
							update="msgs actTab toolbar" id="delete"
							disabled="#{protectKpiController.selectProtectCorrectAct.id == null}"
							actionListener="#{protectKpiController.deleteProtectCorrectAct}">
							<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
						</p:commandButton>
					</f:facet>
					<f:facet name="right">
						<p:commandButton value="下载模板" ajax="false"
							icon="ui-icon-arrowthick-1-s"   style="margin-right:5px;"
							actionListener="#{protectKpiController.protectActFileDownloadView()}">
							<p:fileDownload value="#{protectKpiController.templateFile}" />
						</p:commandButton>
						<p:commandButton id="newStatBtn" value="上传文件"
							icon="ui-icon-arrowthick-1-n" 
							actionListener="#{protectKpiController.chooseEquipment}">
							<p:ajax event="dialogReturn"
								update="msgs actTab"
								listener="#{protectKpiController.onSelectorChosenProtectCorrectAct}" />
						</p:commandButton>
					</f:facet>
				</p:toolbar>
				<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
					<p:commandButton value="是" type="button"
						styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
					<p:commandButton value="否" type="button"
						styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
				</p:confirmDialog>
				<p:dataTable value="#{protectKpiController.protectCorrectActs}"
					var="act" paginator="true" id="actTab" emptyMessage="无记录"
					rowKey="#{act.id}" rowIndexVar="ite" rows="15" selection="#{protectKpiController.selectProtectCorrectAct}"
					paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="15,50,100" paginatorPosition="bottom"
					style="text-align:center;margin-top:3px">
					<f:facet name="{Customization}">
						<p:outputLabel value="总计：#{protectKpiController.protectCorrectActs.size()} 条记录" style="margin-right:20px;" />
					</f:facet>
					<p:ajax event="rowSelectRadio" listener="#{protectKpiController.onRowSelectProtectCorrectAct}" update="protectActForm:edit  protectActForm:delete" />
					<p:column selectionMode="single" width="60" style="text-align:center" />
					<p:column width="60" headerText="序号">
						<h:outputText value="#{ite+1}" />
					</p:column>
					<p:column headerText="子公司">
						<p:outputLabel value="#{act.subCompany}" />
					</p:column>
					<p:column headerText="保护动作次数">
						<p:outputLabel value="#{act.actNum}" />
					</p:column>
					<p:column headerText="保护不正确动作次数">
						<p:outputLabel value="#{act.unwantedActNum}" />
					</p:column>
					<p:column headerText="保护正确动作率(%)">
						<p:outputLabel value="#{act.reality}" >
							<f:convertNumber pattern="0.00"/>
						</p:outputLabel>
						<!-- <p:outputLabel rendered="#{act.reality != null}" value="%" /> -->
						<p:outputLabel rendered="#{act.reality == null}" value="——" />
					</p:column>
					<p:column headerText="计划保护正确动作率(%)">
						<p:outputLabel value="#{act.plan}" >
							<f:convertNumber pattern="0.00"/>
						</p:outputLabel>
						<!-- <p:outputLabel rendered="#{act.plan != null}" value="%" /> -->
						<p:outputLabel rendered="#{act.plan == null}" value="——" />
					</p:column>
					<p:column headerText="时间">
						<p:outputLabel value="#{act.year}"/>
						<p:outputLabel value="-#{act.month}" rendered="#{act.month != null}" />
					</p:column>
					<p:column headerText="电压等级(kV)">
						<p:outputLabel value="#{act.voltage}" />
						<!-- <p:outputLabel rendered="#{act.voltage != null}" value="kV" /> -->
						<p:outputLabel rendered="#{act.voltage == null}" value="——" />
					</p:column>
					<p:column headerText="数据来源">
						<p:outputLabel value="#{act.status==0?'系统统计':'人工创建'}" />
					</p:column>
				</p:dataTable>
			</p:dialog>
		</h:form>
		<!-- <h:form id="protectActCreateDlgForm">
			<p:dialog id="protectActCreateDlg" widgetVar="protectActCreateDlg" header="保护正确动作率  新建" width="400" height="350" modal="true">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk" validateClient="true"
							actionListener="#{protectKpiController.saveProtectCorrectAct}"
							update="protectActForm:msgs protectActForm:actTab protectActForm:toolbar"
							oncomplete="PF('protectActCreateDlg').hide()" />
					</f:facet>
				</p:toolbar>
				<p:panelGrid>
					<p:row>
						<p:column>
							<h:outputText value="年" />
						</p:column>
						<p:column>
							<p:spinner style="margin-right:20px;" min="0" 
								value="#{protectKpiController.protectCorrectAct.year}"/>
						</p:column>
					</p:row>
					<p:row rendered="#{protectKpiController.selectType == 1}">
						<p:column>
							<h:outputText value="月" />
						</p:column>
						<p:column>
							<p:autoComplete dropdown="true"
								value="#{protectKpiController.protectCorrectAct.month}"  scrollHeight="200"
								completeMethod="#{protectKpiController.complateMonths}" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="子公司" />
						</p:column>
						<p:column>
							<p:autoComplete
								value="#{protectKpiController.protectCorrectAct.subCompany}"
								completeMethod="#{protectKpiController.completeSubCompany}"
								dropdown="true" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="电压等级" />
						</p:column>
						<p:column>
							<p:selectOneRadio value="#{protectKpiController.protectCorrectAct.voltage}">
								<f:selectItems value="#{protectKpiController.voltages}" var="item"
									itemValue="#{item}" itemLabel="#{item}kV" />
							</p:selectOneRadio>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="保护动作次数" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.protectCorrectAct.actNum}" minValue="0" 
								thousandSeparator="" decimalPlaces="0"/>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="保护不正确动作次数" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.protectCorrectAct.unwantedActNum}"
								thousandSeparator="" minValue="0" decimalPlaces="0"/>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="计划保护正确动作率" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.protectCorrectAct.plan}" 
								thousandSeparator="" decimalPlaces="2" maxValue="100.00" minValue="0.00"/>
							% 
						</p:column>
					</p:row>
				</p:panelGrid>
			</p:dialog>
		</h:form> -->
		<h:form id="protectActEditDlgForm">
			<p:dialog id="protectActEditDlg" widgetVar="protectActEditDlg" header="保护正确动作率  编辑" width="400" height="350" modal="true">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk" validateClient="true"
							actionListener="#{protectKpiController.saveProtectCorrectAct}"
							update="protectActForm:msgs protectActForm:actTab protectActForm:toolbar"
							oncomplete="PF('protectActEditDlg').hide()" />
					</f:facet>
				</p:toolbar>
				<p:panelGrid>
					<p:row>
						<p:column>
							<h:outputText value="年" />
						</p:column>
						<p:column>
							<p:spinner style="margin-right:20px;" min="0" 
								value="#{protectKpiController.protectCorrectAct.year}"/>
						</p:column>
					</p:row>
					<p:row rendered="#{protectKpiController.queryType == 1}">
						<p:column>
							<h:outputText value="月" />
						</p:column>
						<p:column>
							<p:autoComplete dropdown="true"
								value="#{protectKpiController.protectCorrectAct.month}"  scrollHeight="200"
								completeMethod="#{protectKpiController.complateMonths}" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="单位" />
						</p:column>
						<p:column>
							<p:autoComplete
								value="#{protectKpiController.protectCorrectAct.subCompany}"
								completeMethod="#{protectKpiController.completeSubCompany}"
								dropdown="true" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="电压等级" />
						</p:column>
						<p:column>
							<p:selectOneRadio value="#{protectKpiController.protectCorrectAct.voltage}">
								<f:selectItems value="#{protectKpiController.voltages}" var="item"
									itemValue="#{item}" itemLabel="#{item}kV" />
							</p:selectOneRadio>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="保护动作次数" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.protectCorrectAct.actNum}" 
								thousandSeparator="" minValue="0" decimalPlaces="0"/>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="保护不正确动作次数" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.protectCorrectAct.unwantedActNum}"
								thousandSeparator="" minValue="0" decimalPlaces="0"/>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="计划保护正确动作率" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.protectCorrectAct.plan}" 
								thousandSeparator="" decimalPlaces="2" maxValue="100.00" minValue="0.00"/>
							% 
						</p:column>
					</p:row>
				</p:panelGrid>
			</p:dialog>
		</h:form>

		<h:form id="faultRemoveForm">
			<p:dialog widgetVar="maintFaultRemoveDlg" header="故障快速切除率数据维护" modal="true"
				id="maintFaultRemoveDlg" width="1300" height="700" onHide="updateChartData()" onShow="initQueryYear1()">
				<p:growl id="msgs" showDetail="true" />
				<div class="box box-primary box-solid with-border" style="padding:7px;">
					<p:remoteCommand name="selectQueryYear" actionListener="#{protectKpiController.selectQueryYear}" />
				    <h:panelGrid id="toolbars" columns="13" style="margin-left:10px" >
						<p:selectOneRadio id="queryType" value="#{protectKpiController.queryType}" style="margin-right:5px;">
							<p:ajax event="valueChange" listener="#{protectKpiController.queryFaultFastRemove}" oncomplete="initQueryYear1()" update="toolbars toolbar actTab"/>
							<f:selectItem itemLabel="年指标维护" itemValue="0" />
							<f:selectItem itemLabel="月指标维护" itemValue="1" />
						</p:selectOneRadio>
						<p:outputLabel value="年：" />
						<!-- <p:spinner size="8" style="margin-right:10px;" min="0" max="#{protectKpiController.getCurrentYear()}" value="#{protectKpiController.mYear}"/> -->
						<input type="text" id="mYear1" onchange="changeQueryYear1()" style="width:60px;text-align:center;margin-right:10px;" />	
						
						<p:outputLabel value="月：" style="margin-bottom:10px;margin-top:7px;"/>
						<h:selectOneMenu value="#{protectKpiController.mMonth}"
							rendered="#{protectKpiController.queryType == 1}"
							style="width:60px;margin-right:10px;height:30px">
							<f:selectItem itemValue="0" itemLabel="全年"/>
							<f:selectItems value="#{protectKpiController.months}" />
						</h:selectOneMenu>
						<h:selectOneMenu value="#{protectKpiController.mMonth}"
							rendered="#{protectKpiController.queryType == 0}"
							disabled="#{protectKpiController.queryType == 0}"
							style="width:60px;margin-right:10px;height:30px;background:#dcdcdc;color:transparent">
							<f:selectItem itemValue="0" itemLabel="全年"/>
							<f:selectItems value="#{protectKpiController.months}" />
						</h:selectOneMenu>
						<p:outputLabel value="电压等级 ：" />
						<h:selectOneMenu value="#{protectKpiController.mVoltage}"
							style="width:110px;margin-right:10px;height:30px">
							<!-- <f:selectItem itemValue="0" itemLabel="220kV及以上"/> -->
							<f:selectItems value="#{protectKpiController.voltages}" var="item" itemValue="#{item}" itemLabel="#{item}kV" />
						</h:selectOneMenu>
						<!-- <p:outputLabel value="单位 ："/>
						<h:selectOneMenu value="#{protectKpiController.subCompany}"
							style="width:130px;height:30px;margin-right:20px;" id="actSub">
							<f:selectItem itemLabel="全部" itemValue="全部" />
							<f:selectItems value="#{protectKpiController.subCompanys}" />
						</h:selectOneMenu> -->
						<p:commandButton value="查询" icon="ui-icon-search" style="margin-right:5px;"
							actionListener="#{protectKpiController.queryFaultFastRemove()}"
							update="toolbar actTab" />
						<p:commandButton value="重置" icon="ui-icon-refresh" style="margin-right:5px;"
							actionListener="#{protectKpiController.resetFaultFastRemove()}"  oncomplete="initQueryYear1()"
							update="toolbar toolbars actTab" />
						<p:commandButton value="统计" icon="fa fa-bar-chart" style="margin-right:5px;"
							actionListener="#{protectKpiController.countCurrentFaultFastRemove}"
							update="actTab msgs">
							<p:confirm header="提示" message="重新统计会覆盖当前年月的统计信息，确定重新统计吗?" icon="ui-icon-alert" />
						</p:commandButton>
						<p:selectBooleanCheckbox style="float: left; margin-left: 5px; margin-top: 6px;" itemLabel="是否覆盖修改数据" 
							value="#{protectKpiController.covered}" />
						<!--<p:commandButton value="统计全部" icon="fa fa-bar-chart"
							actionListener="#{protectKpiController.countAllFaultFastRemove}"
							update="actTab msgs">
							<p:confirm header="提示" message="重新统计会删除所有的统计信息，确定重新统计吗?" icon="ui-icon-alert" />
						</p:commandButton>-->
					</h:panelGrid>
				</div>
				<p:toolbar id="toolbar">
					<f:facet name="left">
						<!-- <p:commandButton value="新建年度指标" icon="ui-icon-plus"  style="margin-right:5px;"
							actionListener="#{protectKpiController.preCreateFaultFastRemove(0)}"
							oncomplete="PF('faultRemoveCreateDlg').show()"
							update="faultRemoveCreateDlgForm:faultRemoveCreateDlg" />
						<p:commandButton value="新建月度指标" icon="ui-icon-plus"  style="margin-right:5px;"
							actionListener="#{protectKpiController.preCreateFaultFastRemove(1)}"
							oncomplete="PF('faultRemoveCreateDlg').show()"
							update="faultRemoveCreateDlgForm:faultRemoveCreateDlg" /> -->
						<p:commandButton value="编辑" icon="ui-icon-pencil" id="edit"  style="margin-right:5px;"
							actionListener="#{protectKpiController.editFaultFastRemove}"
							oncomplete="PF('faultRemoveEditDlg').show()"
							update="faultRemoveEditDlgForm:faultRemoveEditDlg"
							disabled="#{protectKpiController.selectFaultFastRemove.id == null}" />
						<p:commandButton value="删除" icon="ui-icon-trash"
							update="msgs actTab toolbar" id="delete"
							disabled="#{protectKpiController.selectFaultFastRemove.id == null}"
							actionListener="#{protectKpiController.deleteFaultFastRemove}">
							<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
						</p:commandButton>
					</f:facet>
					<f:facet name="right">
						<p:commandButton value="下载模板" ajax="false"
							icon="ui-icon-arrowthick-1-s" style="margin-right:5px;"
							actionListener="#{protectKpiController.faultRemoveFileDownloadView()}">
							<p:fileDownload value="#{protectKpiController.templateFile}" />
						</p:commandButton>
						<p:commandButton id="newStatBtn1" value="上传文件"
							icon="ui-icon-arrowthick-1-n" 
							actionListener="#{protectKpiController.chooseEquipment}">
							<p:ajax event="dialogReturn"
								update="msgs actTab"
								listener="#{protectKpiController.onSelectorChosenFaultFastRemove}" />
						</p:commandButton>
					</f:facet>
				</p:toolbar>
				<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
					<p:commandButton value="是" type="button"
						styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
					<p:commandButton value="否" type="button"
						styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
				</p:confirmDialog>
				<p:dataTable value="#{protectKpiController.faultFastRemoves}"
					var="act" paginator="true" id="actTab" emptyMessage="无记录"
					rowKey="#{act.id}" rowIndexVar="ite" rows="15" selection="#{protectKpiController.selectFaultFastRemove}"
					paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="15,50,100" paginatorPosition="bottom"
					style="text-align:center;margin-top:3px">
					<f:facet name="{Customization}">
						<p:outputLabel value="总计：#{protectKpiController.faultFastRemoves.size()} 条记录" style="margin-right:20px;" />
					</f:facet>
					<p:ajax event="rowSelectRadio" listener="#{protectKpiController.onRowSelectFaultFastRemove}" update="faultRemoveForm:edit  faultRemoveForm:delete" />
					<p:column selectionMode="single" width="60" style="text-align:center" />
					<p:column width="60" headerText="序号">
						<h:outputText value="#{ite+1}" />
					</p:column>
					<p:column headerText="单位">
						<p:outputLabel value="#{act.subCompany}" />
					</p:column>
					<p:column headerText="应评价次数">
						<p:outputLabel value="#{act.wantedActNum}" />
					</p:column>
					<p:column headerText="实际快速动作次数">
						<p:outputLabel value="#{act.actNum}" />
					</p:column>
					<p:column headerText="故障快速切除率(%)">
						<p:outputLabel value="#{act.reality}" >
							<f:convertNumber pattern="0.00"/>
						</p:outputLabel>
						<!-- <p:outputLabel rendered="#{act.reality != null}" value="%" /> -->
						<p:outputLabel rendered="#{act.reality == null}" value="——" />
					</p:column>
					<p:column headerText="计划故障快速切除率(%)">
						<p:outputLabel value="#{act.plan}" >
							<f:convertNumber pattern="0.00"/>
						</p:outputLabel>
						<!-- <p:outputLabel rendered="#{act.plan != null}" value="%" /> -->
						<p:outputLabel rendered="#{act.plan == null}" value="——" />
					</p:column>
					<p:column headerText="时间">
						<p:outputLabel value="#{act.year}"/>
						<p:outputLabel value="-#{act.month}" rendered="#{act.month != null}" />
					</p:column>
					<p:column headerText="电压等级(kV)">
						<p:outputLabel value="#{act.voltage}" />
						<!-- <p:outputLabel rendered="#{act.voltage != null}" value="kV" /> -->
						<p:outputLabel rendered="#{act.voltage == null}" value="——" />
					</p:column>
					<p:column headerText="数据来源">
						<p:outputLabel value="#{act.status==0?'系统统计':'人工创建'}" />
					</p:column>
				</p:dataTable>
			</p:dialog>
		</h:form>
		<!-- <h:form id="faultRemoveCreateDlgForm">
			<p:dialog id="faultRemoveCreateDlg" widgetVar="faultRemoveCreateDlg" header="故障快速切除率  新建" width="400" height="350" modal="true">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk" validateClient="true"
							actionListener="#{protectKpiController.saveFaultFastRemove}"
							update="faultRemoveForm:msgs faultRemoveForm:actTab faultRemoveForm:toolbar"
							oncomplete="PF('faultRemoveCreateDlg').hide()" />
					</f:facet>
				</p:toolbar>
				<p:panelGrid>
					<p:row>
						<p:column>
							<h:outputText value="年" />
						</p:column>
						<p:column>
							<p:spinner style="margin-right:20px;" min="0" 
								value="#{protectKpiController.faultFastRemove.year}"/>
						</p:column>
					</p:row>
					<p:row rendered="#{protectKpiController.selectType == 1}">
						<p:column>
							<h:outputText value="月" />
						</p:column>
						<p:column>
							<p:autoComplete dropdown="true"
								value="#{protectKpiController.faultFastRemove.month}"  scrollHeight="200"
								completeMethod="#{protectKpiController.complateMonths}" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="子公司" />
						</p:column>
						<p:column>
							<p:autoComplete
								value="#{protectKpiController.faultFastRemove.subCompany}"
								completeMethod="#{protectKpiController.completeSubCompany}"
								dropdown="true" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="电压等级" />
						</p:column>
						<p:column>
							<p:selectOneRadio value="#{protectKpiController.faultFastRemove.voltage}">
								<f:selectItems value="#{protectKpiController.voltages}" var="item"
									itemValue="#{item}" itemLabel="#{item}kV" />
							</p:selectOneRadio>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="应评价次数" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.faultFastRemove.actNum}"
								thousandSeparator="" minValue="0" decimalPlaces="0"/>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="实际快速动作次数" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.faultFastRemove.wantedActNum}"
								thousandSeparator="" minValue="0" decimalPlaces="0"/>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="计划故障快速切除率" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.faultFastRemove.plan}" 
								thousandSeparator="" decimalPlaces="2" maxValue="100.00" minValue="0.00"/>
							% 
						</p:column>
					</p:row>
				</p:panelGrid>
			</p:dialog>
		</h:form> -->
		<h:form id="faultRemoveEditDlgForm">
			<p:dialog id="faultRemoveEditDlg" widgetVar="faultRemoveEditDlg" header="故障快速切除率  编辑" width="400" height="350" modal="true">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk" validateClient="true"
							actionListener="#{protectKpiController.saveFaultFastRemove}"
							update="faultRemoveForm:msgs faultRemoveForm:actTab faultRemoveForm:toolbar"
							oncomplete="PF('faultRemoveEditDlg').hide()" />
					</f:facet>
				</p:toolbar>
				<p:panelGrid>
					<p:row>
						<p:column>
							<h:outputText value="年" />
						</p:column>
						<p:column>
							<p:spinner style="margin-right:20px;" min="0" 
								value="#{protectKpiController.faultFastRemove.year}"/>
						</p:column>
					</p:row>
					<p:row rendered="#{protectKpiController.queryType == 1}">
						<p:column>
							<h:outputText value="月" />
						</p:column>
						<p:column>
							<p:autoComplete dropdown="true"
								value="#{protectKpiController.faultFastRemove.month}"  scrollHeight="200"
								completeMethod="#{protectKpiController.complateMonths}" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="子公司" />
						</p:column>
						<p:column>
							<p:autoComplete
								value="#{protectKpiController.faultFastRemove.subCompany}"
								completeMethod="#{protectKpiController.completeSubCompany}"
								dropdown="true" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="电压等级" />
						</p:column>
						<p:column>
							<p:selectOneRadio value="#{protectKpiController.faultFastRemove.voltage}">
								<f:selectItems value="#{protectKpiController.voltages}" var="item"
									itemValue="#{item}" itemLabel="#{item}kV" />
							</p:selectOneRadio>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="应评价次数" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.faultFastRemove.wantedActNum}" 
								thousandSeparator=""	minValue="0" decimalPlaces="0"/>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="实际快速动作次数" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.faultFastRemove.actNum}" 
								thousandSeparator="" minValue="0" decimalPlaces="0"/>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="计划故障快速切除率" />
						</p:column>
						<p:column>
							<p:inputNumber value="#{protectKpiController.faultFastRemove.plan}" 
								thousandSeparator="" decimalPlaces="2" maxValue="100.00" minValue="0.00"/>
							% 
						</p:column>
					</p:row>
				</p:panelGrid>
			</p:dialog>
		</h:form>
	</ui:define>
	<ui:define name="contentend">
		<script src="#{request.contextPath}/resources/plugins/echarts/echarts.js" />
		<script src="#{request.contextPath}/resources/js/mycharts/timeline.js" />
		<script src="#{request.contextPath}/resources/js/mycharts/radarChart.js" />
		<script src="#{request.contextPath}/resources/bootstrap/js/bootstrap-datetimepicker.min.js" />
		<script src='protectKpi.js' />
	</ui:define>
</ui:composition>